View Issue Details

IDProjectCategoryView StatusLast Update
0001955T99X171.00 SKB EagleSW Issuepublic2024-12-19 10:52
Reporter(ALTech) JunGyu Kim Assigned To(SW) Kinbay Wu Due Date2024-06-12 17:45
PrioritynormalSeveritys4-minorReproducibilityalways
Status closedResolutionreopened 
Summary0001955: [Smart3][ATV12] Zemkids app is not downgrade when FW downgrade
DescriptionHi Kinbay,

Our QA found an issue that when FW downgrade, Zemkids app is not downgrade.

[FW 15.542.48]
dumpsys package com.skb.zemkids | grep version
    versionCode=358 minSdk=28 targetSdk=31

[FW 15.542.50]
dumpsys package com.skb.zemkids | grep version
    versionCode=359 minSdk=28 targetSdk=31

In the case of the current UI, when FW downgrades, the UI version is also downgraded, so these routines must be set to zemkids in the same way.
Please check the issue.

Thank you.
Kim
TagsNo tags attached.
Attach Tags

Users monitoring this issue

User List (ALTech) Jong-Hwa JUNG , (ALTech) Sangmin Choi , (ALTech) SY Yoon , (ALTech) Wooshin Kang , (ALTech) Younkwang Jung

Activities

(SW) Kinbay Wu

2024-06-05 17:38

developer   ~0015960

Hi Kim

Is the downgrade process by USB OTA?
Include the keep_data?

Best Regrads
Kinbay

(ALTech) JunGyu Kim

2024-06-05 17:55

developer   ~0015961

Hi Kinbay,

Yes, you can reproduce this issue by USB OTA include the keep data.

Thank you.
Kim

(SW) Kinbay Wu

2024-06-06 10:19

developer   ~0015963

Last edited: 2024-06-06 10:20

Hi Kim

Generally, the OTA upgrade or downgrade process does not automatically modify user-installed applications (third-party apps).
If you force the app to wipe data (without keep_data), Zemkids will revert to version 358.

Best Regards
Kinbay

(ALTech) Younkwang Jung

2024-06-10 12:56

developer   ~0015973

Hi Kinbay

zemkids is not a user-installed application.
The zemkids app is a prebuilt app, but it was compressed for free space. (stub.apk)
https://btracker-cns.fii-foxconn.com/vaas/view.php?id=1555
so this issue was observed

If the compressed app at new FW is different from the installed version after FW update
STB must uninstall the existing app(zemkids) and install a new version.

Please check it

Thank you
YK.Jung

(ALTech) Jong-Hwa JUNG

2024-06-11 08:01

developer   ~0015976

Reminder sent to: (ALTech) Jong-Hwa JUNG

(ALTech) Jong-Hwa JUNG

2024-06-11 13:15

developer   ~0015984

Dear Kndbay

This issue is set to BMT issue. so it is necessary to be fixed until tomorrow.
( because it is determined next software image )
=== https://jira.skbroadband.com/browse/BPM-33466
please support this isssue ASAP.
Thank you. Best Regards.

(ALTech) Jong-Hwa JUNG

2024-06-12 09:10

developer   ~0015990

Dear Kinbay

Could you let me know when this issue can be fixed ? ( roughly schedule is okay as well )
Because this issue was changed to BMT issue yesterday, we don't have many time to apply patch for next release.
I'm sorry for repeatedly request.
Best Regards.

(SW) Kinbay Wu

2024-06-12 10:34

developer   ~0015992

Last edited: 2024-06-12 10:35

Hi Jong-Hwa

I will do my best. But I am not sure that can be fixed today.

I found the log at PackageManager
The pm(PackageManager) detects version 359 better than 358 so stuck in the process.
I'm trying to skip version checking for the zemkids app
---------------------
05-09 20:57:44.389  3780  3810 I SystemConfig: Reading permissions from /system/etc/permissions/privapp-permissions-com.skb.zemkids.xml
05-09 20:57:45.414  3780  3780 I PackageManager: getCompressedFiles[/system/priv-app/SKB_ZemKids_SMART3_foxconn-Stub]: [/system/priv-app/SKB_ZemKids_SMART3_foxconn/SKB_ZemKids_SMART3_foxconn.apk.gz]
05-09 20:57:45.417  3780  3780 W PackageManager: Failed to scan /system/priv-app/SKB_ZemKids_SMART3_foxconn-Stub: Package com.skb.zemkids at /system/priv-app/SKB_ZemKids_SMART3_foxconn-Stub ignored: updated version 359 better than this 358
05-09 20:57:45.615  3780  3780 W PackageManager: Failed to parse /system/priv-app/SKB_ZemKids_SMART3_foxconn: Missing base APK in /system/priv-app/SKB_ZemKids_SMART3_foxconn
05-09 20:57:47.029  3780  3780 W PackageManager: Relax SCAN_REQUIRE_KNOWN requirement for package com.skb.zemkids
05-09 20:58:01.445  3780  3780 V StorageManagerService: Package com.skb.zemkids does not have legacy storage
---------------------

Best Regards
Kinbay

(ALTech) Jong-Hwa JUNG

2024-06-12 11:42

developer   ~0015994

Dear Kndbay

I really appreciate your quick updates. Best Regards.
JONGHWA/JUNG

(SW) Kinbay Wu

2024-06-12 18:39

developer   ~0015999

Last edited: 2024-06-12 18:40

Hi Jong-Hwa
 
I have resolved the problem with the attached patch. (path: frameworks/base/)
If the Zemkids app is detected, it will skip the version comparison.
Only check whether the version is different or not.

Below is a log for reinstalling the app, please check.
-----------------
05-09 21:25:38.766 3779 3779 I PackageManager: getCompressedFiles[/system/priv-app/SKB_ZemKids_SMART3_foxconn-Stub]: [/system/priv-app/SKB_ZemKids_SMART3_foxconn/SKB_ZemKids_SMART3_foxconn.apk.gz]
05-09 21:25:38.767 3779 3779 W PackageManager: Detect com.skb.zemkids force reinstall the app
05-09 21:25:38.768 3779 3779 W PackageManager: System package updated; name: com.skb.zemkids; 359 --> 358; /data/app/~~Igb1libgOW8rwpDCg_Zjqg==/com.skb.zemkids-xp8JZl9x_-0U_h27cormIA== --> /system/priv-app/SKB_ZemKids_SMART3_foxconn-Stub
05-09 21:25:38.794 3779 3779 I PackageManager: /system/priv-app/SKB_ZemKids_SMART3_foxconn-Stub changed; collecting certs (forced)
05-09 21:25:38.801 3779 3779 I PackageManager: getCompressedFiles[/system/priv-app/SKB_ZemKids_SMART3_foxconn-Stub]: [/system/priv-app/SKB_ZemKids_SMART3_foxconn/SKB_ZemKids_SMART3_foxconn.apk.gz]
05-09 21:25:38.801 3779 3779 I PackageManager: Update system package com.skb.zemkids code path from /data/app/~~Igb1libgOW8rwpDCg_Zjqg==/com.skb.zemkids-xp8JZl9x_-0U_h27cormIA== to /system/priv-app/SKB_ZemKids_SMART3_foxconn-Stub; Retain data and using new
-----------------
Best Regards
Kinbay
ZemKids_cannot_dwongrade.diff (1,317 bytes)   
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java
index 17f6c41b3f8b..f149199ac3e0 100644
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -12126,8 +12126,12 @@ public class PackageManagerService extends IPackageManager.Stub
 
         final boolean newPkgChangedPaths = pkgAlreadyExists
                 && !pkgSetting.getPathString().equals(parsedPackage.getPath());
+        final boolean zemkids_upgrade = 
+                pkgAlreadyExists && pkgSetting.name.equals("com.skb.zemkids") && parsedPackage.getLongVersionCode() != pkgSetting.versionCode;
+        if (zemkids_upgrade) 
+            Slog.w(TAG, "Detect "+ pkgSetting.name +" force reinstall the app");
         final boolean newPkgVersionGreater =
-                pkgAlreadyExists && parsedPackage.getLongVersionCode() > pkgSetting.versionCode;
+                pkgAlreadyExists && (parsedPackage.getLongVersionCode() > pkgSetting.versionCode || zemkids_upgrade);
         final boolean isSystemPkgBetter = scanSystemPartition && isSystemPkgUpdated
                 && newPkgChangedPaths && newPkgVersionGreater;
         if (isSystemPkgBetter) {
ZemKids_cannot_dwongrade.diff (1,317 bytes)   

(ALTech) Jong-Hwa JUNG

2024-06-13 13:52

developer   ~0016004

Dear Kinbay

We are applying your patch and testing this issue now.
Almost test cases are passed but there is fail result for specific test case.
BFX-AT100 has 2 source code tree both Sprint1 & 2. and app version is increased for each source code tree, but there is app which has same version & differnt revision between Sprint 1 & 2.
So, it is necessary to compare revision information instead of version for this issue.
Could you check we can use revision infromation for this issue ?

Thank you. Best Regards

(SW) Kinbay Wu

2024-06-13 14:09

developer   ~0016007

Last edited: 2024-06-13 14:12

Hi Jong-Hwa

I am not clear what you mean by it.
What is version & revision? Can you give an example?

BTW, I can't see any branch name Sprint on framework/base or vendor/skb/prebuilts/digicap_zemkids

Best Regards
Kinbay

(ALTech) Jong-Hwa JUNG

2024-06-13 16:31

developer   ~0016019

Dear Knbay

FYI, I describe specific fail case, fistly.
I made test firmware(=15.542.6012 version) and this firmware is included your patch and it is base on Sprint1 source code branch.
And there is 15.542.102 firmware, and it is base on Sprint2 source code tree.

Unfortunatelly, two firmare's zemkids app use same versionCode, but it's revision is different.
-> 15.542.6012 zamkids : versionCode 361, revision 8320 ( Sprint1 tree)
-> 15.542.102 zamkids : versionCode 361, revision 8317 (Sprint2 tree)
We only check versionCode, even if zamkids app is different each other, it is not updated.

But it is very specific case, so we have discuss internally, it is better that we apply the patch now, and then if we met specific case error, we have solution later.
Please commit this patch to repository. ( JIRA : BPM-33466, https://jira.skbroadband.com/browse/BPM-33466?filter=-3 )
I really appreciate your support.
Best Regards.

(SW) Kinbay Wu

2024-06-13 16:57

developer   ~0016022

Hi Jong Hwa

I just pushed the commit to UI542.

For revision, the checker is determined in PackageManagerService.
The service will impact security, so it is advisable not to change too much for security.

Best Regards
Kinbay

(ALTech) Jong-Hwa JUNG

2024-06-24 09:32

developer   ~0016085

Dear Kinbay
 
We released new firmware with this patch, SKB tested & closed JIRA ticket.
Thank you for support.
Best Regards.

(ALTech) Jong-Hwa JUNG

2024-06-24 09:33

developer   ~0016086

This issue is closed. Thank you for support.
JONGHWA/JUNG

(ALTech) Younkwang Jung

2024-09-06 08:53

developer   ~0016676

Hi Kinbay

side effect of this patch is observed , it was reported to me yesterday evening ,
https://jira.skbroadband.com/browse/BPM-36880

issue is observed in the following cases.
1) Only update Zemkids app
   * Only Zemkids app can be updated through EDMP. (partial update)
     (ex) adb install -r zemkids_upper_version.apk
            zemkids Test app : http://altserver01.duckdns.org/release_by_ALT/BPM-36880/SKB_ZemKids_SMART3VCS_v1.542.0_vc371_r8371_foxconn_20240806.apk
2) rebooting
3) after rebooting , the Zemkids app return to the prebuilt version.
   * the EDMP updated version should be maintained.
   
   That is, after the FW update, it must be changed to the prebuilt Zemkids app
   but normal reboot, the Zemkids app version should not be changed.

If there is a way to solve this, please share your ideas or contents.
This issue should be resolved before 1 p.m. today.
If you don't understand, please contact me.
Please check it quickly.

Thank you
YK.Jung

(SW) Kinbay Wu

2024-09-06 11:24

developer   ~0016677

Hi YK,
 
I attached the patch, which I added to the mIsUpgrade condition to fix the side effects.
Please check it.
 
BR,
Kinbay
0001-BPM-36880-MT-1955-Fix-the-ZemKids-app-version-will-r.patch (1,618 bytes)   
From acafe72f401d4ad0f1f8f5b8b52fff88274af63d Mon Sep 17 00:00:00 2001
From: Kinbay_Wu <kinbay.ty.wu@fii-foxconn.com>
Date: Fri, 6 Sep 2024 11:18:20 +0800
Subject: [PATCH] [BPM-36880] [MT-1955] Fix the ZemKids app version will reset
 to the prebuilt version after reboot

Signed-off-by: Kinbay_Wu <kinbay.ty.wu@fii-foxconn.com>
---
 .../java/com/android/server/pm/PackageManagerService.java   | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java
index f149199ac3e0..fe40947c57da 100644
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -12126,8 +12126,10 @@ public class PackageManagerService extends IPackageManager.Stub
 
         final boolean newPkgChangedPaths = pkgAlreadyExists
                 && !pkgSetting.getPathString().equals(parsedPackage.getPath());
-        final boolean zemkids_upgrade = 
-                pkgAlreadyExists && pkgSetting.name.equals("com.skb.zemkids") && parsedPackage.getLongVersionCode() != pkgSetting.versionCode;
+        final boolean zemkids_upgrade = pkgAlreadyExists
+                && mIsUpgrade 
+                && pkgSetting.name.equals("com.skb.zemkids") 
+                && parsedPackage.getLongVersionCode() != pkgSetting.versionCode;
         if (zemkids_upgrade) 
             Slog.w(TAG, "Detect "+ pkgSetting.name +" force reinstall the app");
         final boolean newPkgVersionGreater =
-- 
2.25.1

(ALTech) Younkwang Jung

2024-09-06 11:47

developer   ~0016678

Hi Kinbay

Thank you for your support.
First , I've checked the code and I'll give you feedback.

Thank you
YK.Jung

(ALTech) Younkwang Jung

2024-09-06 13:48

developer   ~0016679

Hi Kinbay

The test result is OK. thank you for your quick support.
Pleasse add BPM-36880 to the prefix message and push this patch to UI543 / UI542_CUG bitbucket.
Please let me know when you're done.

Thank you
YK.Jung

(SW) Kinbay Wu

2024-09-06 14:13

developer   ~0016681

Hi YK,

Pushed done.
Please check it.

BR,
Kinbay

Issue History

Date Modified Username Field Change
2024-06-05 16:58 (ALTech) JunGyu Kim New Issue
2024-06-05 16:58 (ALTech) JunGyu Kim Status new => assigned
2024-06-05 16:58 (ALTech) JunGyu Kim Assigned To => (SW) Kinbay Wu
2024-06-05 16:58 (ALTech) JunGyu Kim Issue Monitored: (ALTech) SY Yoon
2024-06-05 16:58 (ALTech) JunGyu Kim Issue Monitored: (ALTech) Wooshin Kang
2024-06-05 16:58 (ALTech) JunGyu Kim Issue Monitored: (ALTech) Younkwang Jung
2024-06-05 16:59 (ALTech) JunGyu Kim Issue Monitored: (ALTech) Sangmin Choi
2024-06-05 17:38 (SW) Kinbay Wu Note Added: 0015960
2024-06-05 17:55 (ALTech) JunGyu Kim Note Added: 0015961
2024-06-06 10:19 (SW) Kinbay Wu Note Added: 0015963
2024-06-06 10:20 (SW) Kinbay Wu Note Edited: 0015963
2024-06-10 12:56 (ALTech) Younkwang Jung Note Added: 0015973
2024-06-10 12:58 (ALTech) Younkwang Jung Issue Monitored: (ALTech) Jong-Hwa JUNG
2024-06-11 08:01 (ALTech) Jong-Hwa JUNG Note Added: 0015976
2024-06-11 13:05 (ALTech) Younkwang Jung Due Date 2024-06-14 17:45 => 2024-06-13 17:45
2024-06-11 13:09 (ALTech) Jong-Hwa JUNG Due Date 2024-06-13 17:45 => 2024-06-12 17:45
2024-06-11 13:15 (ALTech) Jong-Hwa JUNG Note Added: 0015984
2024-06-12 09:10 (ALTech) Jong-Hwa JUNG Note Added: 0015990
2024-06-12 10:34 (SW) Kinbay Wu Note Added: 0015992
2024-06-12 10:35 (SW) Kinbay Wu Note Edited: 0015992
2024-06-12 11:42 (ALTech) Jong-Hwa JUNG Note Added: 0015994
2024-06-12 18:39 (SW) Kinbay Wu Note Added: 0015999
2024-06-12 18:39 (SW) Kinbay Wu File Added: ZemKids_cannot_dwongrade.diff
2024-06-12 18:40 (SW) Kinbay Wu Note Edited: 0015999
2024-06-13 13:52 (ALTech) Jong-Hwa JUNG Note Added: 0016004
2024-06-13 14:09 (SW) Kinbay Wu Note Added: 0016007
2024-06-13 14:12 (SW) Kinbay Wu Note Edited: 0016007
2024-06-13 16:31 (ALTech) Jong-Hwa JUNG Note Added: 0016019
2024-06-13 16:57 (SW) Kinbay Wu Note Added: 0016022
2024-06-24 09:32 (ALTech) Jong-Hwa JUNG Note Added: 0016085
2024-06-24 09:33 (ALTech) Jong-Hwa JUNG Status assigned => closed
2024-06-24 09:33 (ALTech) Jong-Hwa JUNG Resolution open => fixed
2024-06-24 09:33 (ALTech) Jong-Hwa JUNG Note Added: 0016086
2024-09-06 08:53 (ALTech) Younkwang Jung Status closed => feedback
2024-09-06 08:53 (ALTech) Younkwang Jung Resolution fixed => reopened
2024-09-06 08:53 (ALTech) Younkwang Jung Note Added: 0016676
2024-09-06 11:24 (SW) Kinbay Wu Note Added: 0016677
2024-09-06 11:24 (SW) Kinbay Wu File Added: 0001-BPM-36880-MT-1955-Fix-the-ZemKids-app-version-will-r.patch
2024-09-06 11:47 (ALTech) Younkwang Jung Note Added: 0016678
2024-09-06 13:48 (ALTech) Younkwang Jung Note Added: 0016679
2024-09-06 14:13 (SW) Kinbay Wu Note Added: 0016681
2024-12-19 10:52 (ALTech) JunGyu Kim Status feedback => closed